/**
 * \class IdentExp.cpp
 *
 *  Created on: 4 apr 2011
 *      Author: ytc0039
 */

#include "IdentExp.h"
#include "Ident.h"

//const IdentExp IdentExp::IDENT_EXP(&Ident::IDENT);

IdentExp::IdentExp(const Ident *ident):
m_Ident(ident->clone())
{


}

IdentExp::~IdentExp() {
	m_Ident.reset();
}

void IdentExp::accept(IExpVisitor *v){
	v->VisitIdentExp(this);
}

/// @todo Better to return a sharedPtr
IdentExp* IdentExp::clone() const {
	return (new IdentExp(m_Ident.get()));
}


AbsSyn::IdentPtr IdentExp::getIdent() const
{
	return m_Ident;
}

std::string IdentExp::toString() const {
	return m_Ident->getIdentName();
}


